Repository navigation
Bridge build-out S4: fleet agent enroll --bootstrap + notes kind/reply_to (#14370) - #14416
Conversation
…#14370) Notes (design §4.4): note_message gains kind (note|instruction), reply_to and batch columns (ALTER-on-start like fleet_message). POST /notes/send accepts kind and reply_to; a reply routes store-side to the original note's real sender, so replying to an instruction never exposes who sent it. GET /notes/inbox projects instructions sender-free (from: null); plain notes keep their sender. The store keeps the sender throughout. Fleet: a per-agent credential's groups are the mint-bound ones — a credentialed hello/inbox can no longer re-register its own name into arbitrary groups (Felix's S3 review note on #14370). The shared fleet token keeps caller-supplied groups.
…ject_id (#14370) BwsStore stores a value under a name through the bws CLI (delete then create, so re-enrolment rotates; verified by reading the name back). It is the vault write path bridge provisioning needs: the broker is a read-through cache and fleet-secrets had no write at all. Errors are value-free; the value passes only through the bws child's argv, the documented house pattern. The write project is named by FLEET_BWS_PROJECT_ID or [secrets] bws_project_id. fleet-config: [bridge] notes_token_name and [secrets] bws_project_id, both blank-checked like their siblings.
…14370) exchange trades a single-use bootstrap token at /enroll/exchange for the agent's own credentials and stores them by name (bridge.<agent>-fleet-token, bridge.<agent>-token) through fleet-secrets; it prints names and metadata only, and a refused exchange stores nothing. notes send/inbox/ack carry kind (note|instruction) and reply_to over the identity's own Bearer token (#13907's family surface). Settings learn the credential names the agent profile recorded at enrolment, so a bootstrap-provisioned seat's agent verbs resolve its per-agent credential instead of the shared fleet token.
…14370) enroll --bootstrap runs the bridge exchange first (patient call: it burns the token), adopts the mint-bound groups, saves the profile early with the credential names recorded (never values) so the probe's hello resolves the per-agent credential, then enrols as usual. A Muse seat whose mint carried a notes identity also gets the wake hookup written — the signal-poll detector and hook definition of the hatch-personal messages-hook pattern — so the agent is reachable, not merely registered. A refused exchange enrols nothing.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
ureq's post() starts as RequestBuilder<WithBody> where get() starts WithoutBody; the shared header setter has to be generic over the builder state. Caught by remote run 45413772988.
…otstrap # Conflicts: # pkgs/message-bridge/worker/src/index.js # pkgs/message-bridge/worker/src/messages.js # pkgs/message-bridge/worker/src/notes.js # pkgs/message-bridge/worker/test/notes.test.mjs
…rge fix) The merge of origin/main into felix/14370-enroll-bootstrap placed the #14370 reply branch before the #14367 broaden branch in handleNotes. A broaden body carries no reply_to field, so it fell into the reply branch and was refused. Broaden first restores main's broaden behaviour exactly; reply bodies never carry broaden, so the #14370 reply path is unchanged.
|
Merge-refresh: origin/main merged in, conflicts resolved, re-verified — ready for Felix's merge. New head: Conflicts (4 files; everything else auto-merged)
One merge defect found by verification, fixed in
|
…oute (#14370) storeFor had no noteOrigin wrapper, so notes reply routing threw through the production Durable Object store while MemoryStore-based tests passed. Add the wrapper beside noteBroaden and a regression test (test/do-store.test.mjs) that drives the real default-export fetch and MessageStore DO over node:sqlite: an instruction lands sender-free, a reply naming only its id routes to the hidden sender, and a foreign reply is refused.
The previous commit's file carried a literal placeholder in place of the OWNER fixture value (a redaction artifact from the write path), which is a syntax error; restore ACCESS_TOKEN: OWNER.
|
agent-note:v1 The fix (head
|
…otstrap # Conflicts: # pkgs/fleet/crates/fleet-bridge/src/tests.rs
|
Merge-refresh record (Felix lane, 2026-11-24): merged origin/main Conflicts: exactly one — Re-verification (remote, fleet-command on developing-today/fleet; every log names TARGET HEAD 6e76e9d):
Left unmerged for Felix's merge. |
…otstrap # Conflicts: # pkgs/fleet/crates/fleet-bridge/src/lib.rs
|
Merge-refresh — FINAL record (supersedes the record above, which described the intermediate head): main moved twice during this refresh. Final head Conflicts (2 total across both merges, both pure additive unions, no semantic choices):
Re-verification on final head 90a803f (remote, fleet-command on developing-today/fleet; every log names that TARGET HEAD; all four runs completed success):
Left unmerged for Felix's merge. |
Implements slice S4 of the message-bridge build-out (design doc/2026-11-24_design_message-bridge-buildout.md §4.7 + the client half of §4.4), on top of S3's per-agent credentials and bootstrap tokens (PR #14407).
What lands
Worker (pkgs/message-bridge/worker)
note_messagegainskind(note|instruction),reply_toandbatch(ALTER-on-start, the fleet_message pattern).POST /notes/sendacceptskindandreply_to; a reply routes store-side to the original note's real sender, so an agent can answer an instruction without ever seeing who sent it.GET /notes/inboxprojects instructions sender-free (from: null); plain notes keep their sender. The store keeps the sender throughout.hello/inboxrefreshes last-seen only and cannot re-register its own name into arbitrary groups. The shared fleet token keeps caller-supplied groups.fleet-secrets / fleet-config
BwsStore: the vault write path fleet-secrets lacked (the broker is a read-through cache). Stores by name through thebwsCLI — delete-then-create so re-enrolment rotates, verified by reading the name back. Errors are value-free; the write project comes fromFLEET_BWS_PROJECT_IDor[secrets] bws_project_id. New dependency: none.[bridge] notes_token_name,[secrets] bws_project_id(blank-checked like their siblings).fleet-bridge
exchange: trades the bootstrap token atPOST /enroll/exchangeand stores the returned credentials by name (bridge.<agent>-fleet-token,bridge.<agent>-token). Prints names/metadata only; a refused exchange stores nothing; a store failure after a successful exchange is loud (the token is burned).notes send|inbox|ack: the fleet bridge: send/get/inbox/watch for class/name notes — replacing ad-hoc bridge access #13907 family surface carryingkindandreply_to, authenticated by the identity's own notes token as a Bearer header. (fleet bridge: send/get/inbox/watch for class/name notes — replacing ad-hoc bridge access #13907 stays open forget/watch.)fleet-agent
enroll --bootstrap <token>: exchange first (patient call — it burns the token), mint-bound groups adopted, profile saved early with the credential names (never values) so the probe's hello resolves the per-agent credential, then the existing enrolment (legs, profile, hello under the new credential). For amuseseat whose mint carried a notes identity, enrolment also writes the wake hookup — signal-poll detector + hook definition in the hatch-personalscripts/messages-hook/pattern — so the agent is reachable, not merely registered.--bootstraprefuses--dry-runand non-binary seats; a refused exchange enrols nothing.Book: bridge reference gains the per-agent/notes token rows, the hello pinning note,
exchangeandnotessections; agent reference gains--bootstrap; secrets reference records the write path.Verification (remote only, GitHub-hosted runners via the fleet-command workflow, all at branch head b14681f)
NIXPKGS_ALLOW_UNFREE=1 nix build --impure .#messageBridge --print-build-logs(the package checkPhase runsnode --test test/*.test.mjs, the same route the deploy workflow uses): 80 tests, 79 pass, 0 fail (1 pre-existing skip). New, by name: "instructions land sender-free, notes keep their sender, replies thread to the hidden sender"; "a credentialed hello cannot move its agent into new groups (Bridge build-out S4 — fleet agent enroll --bootstrap + notes kind/reply_to (fleet CLI) #14370)".cargo test -p fleet-bridge: 22 passed, 0 failed, including the newexchange_stores_credentials_by_name_and_prints_no_value,exchange_refusal_stores_nothing_and_says_why,notes_verbs_carry_kind_and_reply_to_under_a_bearer_token,notes_verbs_name_the_missing_token.a_background_cargo_build_holds_its_target_lease_until_exit, which hangs in the executor environment (unchanged on main, unrelated to this slice; filed as fleet-agent test a_background_cargo_build_holds_its_target_lease_until_exit hangs in the fleet-command executor #14446). Run 45415294283 shows the same 97 tests passing individually before that one test stalled the binary. New, by name:bootstrap_enrolment_exchanges_first_saves_names_and_writes_the_wake_hook,a_refused_exchange_enrols_nothing,bootstrap_refuses_a_dry_run_and_a_seat_it_cannot_provision.bws_store_creates_with_the_house_argv_shape_and_verifies,bws_store_replaces_an_existing_name,bws_store_errors_never_carry_the_value,bws_project_id_prefers_env_then_config.Earlier runs: 45413772988 caught a ureq typestate compile error in the first cut of the bearer-call helper (fixed in b14681f); 45413863730 failed before running anything because the executor image has no
nodebinary — hence the nix route for the worker suite above.New dependencies: none.
Closes #14370
Left unmerged for Felix's review.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-24T14:25:20Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "c11f41086f57d626be7eb582763b721f8f557408" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.